﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLCF.Forms
{
    public partial class popupSetPrice : Form
    {
        private frmTableService frmTbS1 = null;
        private int billDetailID;
        public popupSetPrice()
        {
            InitializeComponent();
        }
        public popupSetPrice(frmTableService m_frmTableService, int m_billDetailID,string pName, int price)
        {
            InitializeComponent();
            frmTbS1 = m_frmTableService;
            billDetailID = m_billDetailID;
            lblProductName.Text = pName;
            numPrice.Value = price;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (numPrice.Value <= 0)
                MessageBox.Show("Giá bán phải >0");
            else
            {
                frmTbS1.updatePrice(billDetailID, (int)(numPrice.Value));
                this.Close();
            }
        }
    }
}
